/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package graphics;

import java.io.File;
import java.net.URL;
import tools.Downloader;
import tools.MessageManager;
import tools.TimeManager;
import user.Statistic;

/**
 *
 * @author Mattia
 */
public class MainFrame extends javax.swing.JFrame {

    /**
     * Creates new form MainFrame
     */
    public MainFrame() {
        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        Container = new javax.swing.JPanel();
        BTN_Download_Firefox = new javax.swing.JButton();
        BTN_Download_Chrome = new javax.swing.JButton();
        BTN_Download_UrbanTerror = new javax.swing.JButton();
        Layered = new javax.swing.JLayeredPane();
        Label_Action = new javax.swing.JLabel();
        Label_Version = new javax.swing.JLabel();
        BTN_Contacts = new javax.swing.JButton();
        BTN_Exit = new javax.swing.JButton();
        Logo = new javax.swing.JLabel();
        MenuBar = new javax.swing.JMenuBar();
        Menu_File = new javax.swing.JMenu();
        Menu_File_Settings = new javax.swing.JMenuItem();
        Menu_File_Separator = new javax.swing.JPopupMenu.Separator();
        Menu_File_Exit = new javax.swing.JMenuItem();
        Menu_Download = new javax.swing.JMenu();
        Menu_Download_Firefox = new javax.swing.JMenuItem();
        Menu_Download_Chrome = new javax.swing.JMenuItem();
        Menu_About = new javax.swing.JMenu();
        Menu_About_Credits = new javax.swing.JMenuItem();
        Menu_About_License = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Amunaptra");
        setBackground(new java.awt.Color(255, 255, 255));
        setResizable(false);

        Container.setBackground(new java.awt.Color(255, 255, 255));
        Container.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        BTN_Download_Firefox.setBackground(new java.awt.Color(255, 255, 255));
        BTN_Download_Firefox.setIcon(new javax.swing.ImageIcon(getClass().getResource("/graphics/image/BTN_firefox.png"))); // NOI18N
        BTN_Download_Firefox.setBorder(null);
        BTN_Download_Firefox.setContentAreaFilled(false);
        BTN_Download_Firefox.setOpaque(true);
        BTN_Download_Firefox.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                BTN_Download_FirefoxMouseReleased(evt);
            }
            public void mousePressed(java.awt.event.MouseEvent evt) {
                BTN_Download_FirefoxMousePressed(evt);
            }
        });
        BTN_Download_Firefox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BTN_Download_FirefoxActionPerformed(evt);
            }
        });

        BTN_Download_Chrome.setBackground(new java.awt.Color(255, 255, 255));
        BTN_Download_Chrome.setIcon(new javax.swing.ImageIcon(getClass().getResource("/graphics/image/BTN_chromium.png"))); // NOI18N
        BTN_Download_Chrome.setBorder(null);
        BTN_Download_Chrome.setContentAreaFilled(false);
        BTN_Download_Chrome.setOpaque(true);
        BTN_Download_Chrome.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                BTN_Download_ChromeMouseReleased(evt);
            }
            public void mousePressed(java.awt.event.MouseEvent evt) {
                BTN_Download_ChromeMousePressed(evt);
            }
        });
        BTN_Download_Chrome.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BTN_Download_ChromeActionPerformed(evt);
            }
        });

        BTN_Download_UrbanTerror.setBackground(new java.awt.Color(255, 255, 255));
        BTN_Download_UrbanTerror.setIcon(new javax.swing.ImageIcon(getClass().getResource("/graphics/image/BTN_urbanterror.png"))); // NOI18N
        BTN_Download_UrbanTerror.setBorder(null);
        BTN_Download_UrbanTerror.setContentAreaFilled(false);
        BTN_Download_UrbanTerror.setOpaque(true);
        BTN_Download_UrbanTerror.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                BTN_Download_UrbanTerrorMouseReleased(evt);
            }
            public void mousePressed(java.awt.event.MouseEvent evt) {
                BTN_Download_UrbanTerrorMousePressed(evt);
            }
        });
        BTN_Download_UrbanTerror.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BTN_Download_UrbanTerrorActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout ContainerLayout = new javax.swing.GroupLayout(Container);
        Container.setLayout(ContainerLayout);
        ContainerLayout.setHorizontalGroup(
            ContainerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(ContainerLayout.createSequentialGroup()
                .addComponent(BTN_Download_Firefox)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(BTN_Download_Chrome)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(BTN_Download_UrbanTerror))
        );
        ContainerLayout.setVerticalGroup(
            ContainerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(BTN_Download_Firefox, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(BTN_Download_Chrome, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(BTN_Download_UrbanTerror, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        Label_Action.setFont(new java.awt.Font("Tahoma", 0, 9)); // NOI18N
        Label_Action.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        Label_Action.setText("www.amunaptra.zagomattia.it");
        Label_Action.setBounds(200, 130, 260, 11);
        Layered.add(Label_Action, javax.swing.JLayeredPane.DEFAULT_LAYER);

        Label_Version.setFont(new java.awt.Font("Tahoma", 0, 9)); // NOI18N
        Label_Version.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        Label_Version.setText("Copyright 2012 - Zago Mattia - Versione 3.1");
        Label_Version.setBounds(200, 150, 260, 11);
        Layered.add(Label_Version, javax.swing.JLayeredPane.DEFAULT_LAYER);

        BTN_Contacts.setBackground(new java.awt.Color(255, 255, 255));
        BTN_Contacts.setIcon(new javax.swing.ImageIcon(getClass().getResource("/graphics/image/BTN_Contacts.png"))); // NOI18N
        BTN_Contacts.setBorder(null);
        BTN_Contacts.setContentAreaFilled(false);
        BTN_Contacts.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                BTN_ContactsMouseReleased(evt);
            }
            public void mousePressed(java.awt.event.MouseEvent evt) {
                BTN_ContactsMousePressed(evt);
            }
        });
        BTN_Contacts.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BTN_ContactsActionPerformed(evt);
            }
        });
        BTN_Contacts.setBounds(480, 10, 70, 74);
        Layered.add(BTN_Contacts, javax.swing.JLayeredPane.DEFAULT_LAYER);

        BTN_Exit.setBackground(new java.awt.Color(255, 255, 255));
        BTN_Exit.setIcon(new javax.swing.ImageIcon(getClass().getResource("/graphics/image/BTN_exit.png"))); // NOI18N
        BTN_Exit.setBorder(null);
        BTN_Exit.setContentAreaFilled(false);
        BTN_Exit.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseReleased(java.awt.event.MouseEvent evt) {
                BTN_ExitMouseReleased(evt);
            }
            public void mousePressed(java.awt.event.MouseEvent evt) {
                BTN_ExitMousePressed(evt);
            }
        });
        BTN_Exit.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BTN_ExitActionPerformed(evt);
            }
        });
        BTN_Exit.setBounds(480, 90, 70, 75);
        Layered.add(BTN_Exit, javax.swing.JLayeredPane.DEFAULT_LAYER);

        Logo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/graphics/image/Logo_v3.png"))); // NOI18N
        Logo.setBounds(-30, -20, 580, 190);
        Layered.add(Logo, javax.swing.JLayeredPane.DEFAULT_LAYER);

        MenuBar.setBackground(new java.awt.Color(255, 255, 255));

        Menu_File.setText("File");

        Menu_File_Settings.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.CTRL_MASK));
        Menu_File_Settings.setIcon(new javax.swing.ImageIcon(getClass().getResource("/graphics/image/Settings_small.png"))); // NOI18N
        Menu_File_Settings.setText("Settings");
        Menu_File_Settings.setEnabled(false);
        Menu_File.add(Menu_File_Settings);
        Menu_File.add(Menu_File_Separator);

        Menu_File_Exit.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F4, java.awt.event.InputEvent.ALT_MASK));
        Menu_File_Exit.setIcon(new javax.swing.ImageIcon(getClass().getResource("/graphics/image/ShutDown_Small.png"))); // NOI18N
        Menu_File_Exit.setText("Exit");
        Menu_File_Exit.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                Menu_File_ExitActionPerformed(evt);
            }
        });
        Menu_File.add(Menu_File_Exit);

        MenuBar.add(Menu_File);

        Menu_Download.setText("Download");

        Menu_Download_Firefox.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F, java.awt.event.InputEvent.ALT_MASK));
        Menu_Download_Firefox.setIcon(new javax.swing.ImageIcon(getClass().getResource("/graphics/image/Firefox_Small.png"))); // NOI18N
        Menu_Download_Firefox.setText("Firefox");
        Menu_Download_Firefox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                Menu_Download_FirefoxActionPerformed(evt);
            }
        });
        Menu_Download.add(Menu_Download_Firefox);

        Menu_Download_Chrome.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_C, java.awt.event.InputEvent.ALT_MASK));
        Menu_Download_Chrome.setIcon(new javax.swing.ImageIcon(getClass().getResource("/graphics/image/Chromium_Small.png"))); // NOI18N
        Menu_Download_Chrome.setText("Chromium");
        Menu_Download_Chrome.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                Menu_Download_ChromeActionPerformed(evt);
            }
        });
        Menu_Download.add(Menu_Download_Chrome);

        MenuBar.add(Menu_Download);

        Menu_About.setText("About");

        Menu_About_Credits.setIcon(new javax.swing.ImageIcon(getClass().getResource("/graphics/image/Contacts_Small.png"))); // NOI18N
        Menu_About_Credits.setText("Credits");
        Menu_About_Credits.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                Menu_About_CreditsActionPerformed(evt);
            }
        });
        Menu_About.add(Menu_About_Credits);

        Menu_About_License.setIcon(new javax.swing.ImageIcon(getClass().getResource("/graphics/image/License_smalll.png"))); // NOI18N
        Menu_About_License.setText("Licenza Chromium");
        Menu_About_License.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                Menu_About_LicenseActionPerformed(evt);
            }
        });
        Menu_About.add(Menu_About_License);

        MenuBar.add(Menu_About);

        setJMenuBar(MenuBar);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(Layered)
            .addComponent(Container, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(Layered, javax.swing.GroupLayout.PREFERRED_SIZE, 166, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(Container, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void Menu_Download_FirefoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Menu_Download_FirefoxActionPerformed
        BTN_Download_FirefoxActionPerformed(evt);
    }//GEN-LAST:event_Menu_Download_FirefoxActionPerformed

    private void Menu_Download_ChromeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Menu_Download_ChromeActionPerformed
        BTN_Download_ChromeActionPerformed(evt);
    }//GEN-LAST:event_Menu_Download_ChromeActionPerformed

    private void Menu_About_CreditsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Menu_About_CreditsActionPerformed
        BTN_ContactsActionPerformed(evt);
    }//GEN-LAST:event_Menu_About_CreditsActionPerformed

    private void BTN_ContactsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BTN_ContactsActionPerformed
        Credits c = new Credits(this, true);
        c.setLocationRelativeTo(null);
        c.setVisible(true);
    }//GEN-LAST:event_BTN_ContactsActionPerformed

    private void BTN_ExitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BTN_ExitActionPerformed
        System.exit(0);
    }//GEN-LAST:event_BTN_ExitActionPerformed
    
    private void download(String urlString) {
        final ProgressFrame rsc = new ProgressFrame();
        // Setup della finestra di download
        String name = "";
        if(urlString.equals(Downloader.CHROMIUM_URL)) {
            name = "Chromium";
        } else if(urlString.equals(Downloader.FIREFOX_URL)) {
            name = "Firefox";
        } else if(urlString.equals(Downloader.URBANTERROR_URL)) {
            name = "UrbanTerror";
        }
        rsc.setUp(new javax.swing.ImageIcon(getClass().getResource("/graphics/image/"+name+".png")), "Download "+name, null);
        Statistic.updateStatFile(TimeManager.getTimeToString()+" - "+System.getProperty("user.name")+" start \""+name+"\" download");
        URL url = Downloader.verifyUrl(urlString);
        Downloader d = new Downloader(url, rsc);
        
        d.addObserver(rsc);
        d.start();
        rsc.end();        
    }
    
    private void BTN_Download_ChromeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BTN_Download_ChromeActionPerformed
        LicenseDialog f = new LicenseDialog(this, true);
        f.setVisible(true);
        if(f.isAccepted()) {
        String path = Downloader.UNI_PATH+"Chromium";
        if(System.getProperty("os.name").toLowerCase().contains("win")) {path = Downloader.WIN_PATH+"Chromium";}
        if(!new File(path).exists()) {
            download(Downloader.CHROMIUM_URL);
        } else {
            MessageManager.info(this, "Hai già scaricato Chromium!\nControlla in \""+path+"\"", "Download Chromium");
        }  
        } else {
            MessageManager.warning(this, "Devi accettare le condizioni per poter scaricare Chromium", "Download di Chromium non autorizzato");
        }
    }//GEN-LAST:event_BTN_Download_ChromeActionPerformed

    private void BTN_Download_FirefoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BTN_Download_FirefoxActionPerformed
        String path = Downloader.UNI_PATH+"Firefox";
        if(System.getProperty("os.name").toLowerCase().contains("win")) {path = Downloader.WIN_PATH+"Firefox";}
        if(!new File(path).exists()) {
            download(Downloader.FIREFOX_URL);
        } else {
            MessageManager.info(this, "Hai già scaricato Firefox!\nControlla in \""+path+"\"", "Download Firefox");
        }
    }//GEN-LAST:event_BTN_Download_FirefoxActionPerformed

    private void Menu_File_ExitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Menu_File_ExitActionPerformed
        System.exit(0);
    }//GEN-LAST:event_Menu_File_ExitActionPerformed

    private void BTN_Download_ChromeMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_BTN_Download_ChromeMousePressed
        BTN_Download_Chrome.setIcon(new javax.swing.ImageIcon(getClass().getResource("/graphics/image/BTN_chromium_onclick.png")));
    }//GEN-LAST:event_BTN_Download_ChromeMousePressed

    private void BTN_Download_ChromeMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_BTN_Download_ChromeMouseReleased
        BTN_Download_Chrome.setIcon(new javax.swing.ImageIcon(getClass().getResource("/graphics/image/BTN_chromium.png")));
    }//GEN-LAST:event_BTN_Download_ChromeMouseReleased

    private void BTN_Download_FirefoxMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_BTN_Download_FirefoxMousePressed
        BTN_Download_Firefox.setIcon(new javax.swing.ImageIcon(getClass().getResource("/graphics/image/BTN_firefox_onclick.png")));
    }//GEN-LAST:event_BTN_Download_FirefoxMousePressed

    private void BTN_Download_FirefoxMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_BTN_Download_FirefoxMouseReleased
        BTN_Download_Firefox.setIcon(new javax.swing.ImageIcon(getClass().getResource("/graphics/image/BTN_firefox.png")));
    }//GEN-LAST:event_BTN_Download_FirefoxMouseReleased

    private void BTN_ContactsMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_BTN_ContactsMousePressed
        BTN_Contacts.setIcon(new javax.swing.ImageIcon(getClass().getResource("/graphics/image/BTN_Contacts_onclick.png")));
    }//GEN-LAST:event_BTN_ContactsMousePressed

    private void BTN_ContactsMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_BTN_ContactsMouseReleased
        BTN_Contacts.setIcon(new javax.swing.ImageIcon(getClass().getResource("/graphics/image/BTN_Contacts.png")));
    }//GEN-LAST:event_BTN_ContactsMouseReleased

    private void BTN_ExitMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_BTN_ExitMousePressed
        BTN_Exit.setIcon(new javax.swing.ImageIcon(getClass().getResource("/graphics/image/BTN_Exit_onclick.png")));
    }//GEN-LAST:event_BTN_ExitMousePressed

    private void BTN_ExitMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_BTN_ExitMouseReleased
        BTN_Exit.setIcon(new javax.swing.ImageIcon(getClass().getResource("/graphics/image/BTN_Exit.png")));
    }//GEN-LAST:event_BTN_ExitMouseReleased

    private void Menu_About_LicenseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_Menu_About_LicenseActionPerformed
        new LicenseDialog(this, true).setVisible(true);
    }//GEN-LAST:event_Menu_About_LicenseActionPerformed

    private void BTN_Download_UrbanTerrorMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_BTN_Download_UrbanTerrorMousePressed
        BTN_Download_UrbanTerror.setIcon(new javax.swing.ImageIcon(getClass().getResource("/graphics/image/BTN_urbanterror_onclick.png")));
    }//GEN-LAST:event_BTN_Download_UrbanTerrorMousePressed

    private void BTN_Download_UrbanTerrorMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_BTN_Download_UrbanTerrorMouseReleased
        BTN_Download_UrbanTerror.setIcon(new javax.swing.ImageIcon(getClass().getResource("/graphics/image/BTN_urbanterror.png")));
    }//GEN-LAST:event_BTN_Download_UrbanTerrorMouseReleased

    private void BTN_Download_UrbanTerrorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_BTN_Download_UrbanTerrorActionPerformed
        String path = Downloader.UNI_PATH+"UrbanTerror";
        if(System.getProperty("os.name").toLowerCase().contains("win")) {path = Downloader.WIN_PATH+"UrbanTerror";}
        if(!new File(path).exists()) {
            download(Downloader.URBANTERROR_URL);
        } else {
            MessageManager.info(this, "Hai già scaricato UrbanTerror!\nControlla in \""+path+"\"", "Download UrbanTerror");
        }
    }//GEN-LAST:event_BTN_Download_UrbanTerrorActionPerformed
    int i = 0;
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton BTN_Contacts;
    private javax.swing.JButton BTN_Download_Chrome;
    private javax.swing.JButton BTN_Download_Firefox;
    private javax.swing.JButton BTN_Download_UrbanTerror;
    private javax.swing.JButton BTN_Exit;
    private javax.swing.JPanel Container;
    public javax.swing.JLabel Label_Action;
    private javax.swing.JLabel Label_Version;
    private javax.swing.JLayeredPane Layered;
    private javax.swing.JLabel Logo;
    private javax.swing.JMenuBar MenuBar;
    private javax.swing.JMenu Menu_About;
    private javax.swing.JMenuItem Menu_About_Credits;
    private javax.swing.JMenuItem Menu_About_License;
    private javax.swing.JMenu Menu_Download;
    private javax.swing.JMenuItem Menu_Download_Chrome;
    private javax.swing.JMenuItem Menu_Download_Firefox;
    private javax.swing.JMenu Menu_File;
    private javax.swing.JMenuItem Menu_File_Exit;
    private javax.swing.JPopupMenu.Separator Menu_File_Separator;
    private javax.swing.JMenuItem Menu_File_Settings;
    // End of variables declaration//GEN-END:variables

    public class MyThread extends Thread {

        private MyThread(Runnable runnable) {
            super(runnable);
        }

        public void changeFlag(ProgressFrame pr, int i) {
            System.out.println("\tChangeFlag. New Value: " + i);
            pr.ProgressBar.setValue(i);
        }
    }
}
